package com.ruoyi.interview.domain;


import com.ruoyi.common.core.web.domain.BaseEntity;

import java.util.Objects;

/**
 * 日志表
 */
public class Log extends BaseEntity {

    private Long logId;
    private String userName;
    private String request;
    private String methodName;
    private String ip;
    /** 方法耗时单位毫秒 */
    private Long methodTimeConsuming;

    public Log(Long logId, String userName, String request, String methodName, String ip,Long methodTimeConsuming) {
        this.logId = logId;
        this.userName = userName;
        this.request = request;
        this.methodName = methodName;
        this.ip = ip;
        this.methodTimeConsuming = methodTimeConsuming;
    }

    public Log() {
    }

    public Long getLogId() {
        return logId;
    }

    public void setLogId(Long logId) {
        this.logId = logId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getRequest() {
        return request;
    }

    public void setRequest(String request) {
        this.request = request;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public Long getMethodTimeConsuming() {
        return methodTimeConsuming;
    }

    public void setMethodTimeConsuming(Long methodTimeConsuming) {
        this.methodTimeConsuming = methodTimeConsuming;
    }

    @Override
    public String toString() {
        return "Log{" +
                "logId=" + logId +
                ", userName='" + userName + '\'' +
                ", request='" + request + '\'' +
                ", methodName='" + methodName + '\'' +
                ", ip='" + ip + '\'' +
                ", methodTimeConsuming=" + methodTimeConsuming +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Log log = (Log) o;
        return Objects.equals(logId, log.logId) &&
                Objects.equals(userName, log.userName) &&
                Objects.equals(request, log.request) &&
                Objects.equals(methodName, log.methodName) &&
                Objects.equals(ip, log.ip) &&
                Objects.equals(methodTimeConsuming, log.methodTimeConsuming);
    }

    @Override
    public int hashCode() {
        return Objects.hash(logId, userName, request, methodName, ip, methodTimeConsuming);
    }
}
